<?php 
require_once("includes/config.php"); 
  
  

     if($_SERVER["REQUEST_METHOD"] == "POST"){
      $sql= query("INSERT INTO services (service_name , owner_id) VALUES (?,?)",$_POST['name'],$_SESSION['user_id']);

	   $_SESSION['success_message'] = "تم اضافة الخدمه بنجاح"; 
	   
	    $servs=query("SELECT * FROM services WHERE owner_id =?",$_SESSION['user_id']);
	    redirect("services-settings.php");
      }  
 $servs=query("SELECT * FROM services WHERE owner_id =?",$_SESSION['user_id']);
  render("/settings/services-settings.php", array("title"=>"ادارة الخدمات","servs"=>$servs));
?>